var express = require('express');
var router = express.Router();
/* GET users listing. */
var str = "";
var soap = require('soap');
var url = 'http://localhost:8099/test/user?wsdl';

//使用soap，根据wsdl地址创建客户端
soap.createClient(url, function (err, client) {
    if (err) {
        console.log(err);
    }
    //返回一个客户端，并且传参调用Java的接口，接收返回的数据
    client.getUser({arg0: '411001'}, function (error, result) {
        //打印接收到的数据
        console.log(result);
        str = result.toString();
    });
});

router.get('/', function (req, res, next) {
    res.send('respond with a resource' + str);
});
module.exports = router;
